<?php

namespace app\admin\model\shop\order;

use think\Model;

/**
 * Play
 */
class Play extends Model
{
    // 表名
    protected $name = 'shop_order_play';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;


    public function getCommissionAttr($value): float
    {
        return (float)$value;
    }

    public function order(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\shop\order\Order::class, 'order_id', 'id');
    }

    public function playUser(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\play\User::class, 'play_user_id', 'id');
    }
}